/**
 * 
 */
package com.yidu.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.yidu.bean.TbMenu;
import com.yidu.bean.TbMenuType;
import com.yidu.dao.TbMenuMapper;
import com.yidu.dao.TbMenuTypeMapper;
import com.yidu.message.Page;
import com.yidu.message.Pages;
import com.yidu.service.TbMenuService;

/**
 * 
 * @author liutao
 * @data 2018年7月17日
 * @version 1.0
 */
@Service
public class TbMenuServiceImpl implements TbMenuService{

	Logger logger = Logger.getLogger(TbMemberImpl.class);

	@Resource
	private TbMenuMapper TbMenuDao ;
	
	@Override
	public int delete(String menuId) {
		System.out.println("zheshishanchugfangfa");
		return TbMenuDao.deleteByPrimaryKey(menuId);
	}

	@Override
	public int save(TbMenu menu) {
		// TODO Auto-generated method stub
		return TbMenuDao.insertSelective(menu);
	}

	@Override
	public int update(TbMenu menu) {
		System.out.println("zheshixiugaifangfa");
		logger.info(menu.getMtId());
		return TbMenuDao.updateByPrimaryKeySelective(menu);
	}

	@Override
	public List<TbMenu> findByIdss(String menu_Id) {
		System.out.println("进来到店面的service");
		List<TbMenu> list = (List<TbMenu>) TbMenuDao.findById(menu_Id);
		return list;
	}

	@Override
	public List<TbMenu> Descfind(String menu_Id) {
		System.out.println("进来到店面的service");
		List<TbMenu> list = (List<TbMenu>) TbMenuDao.Descfind(menu_Id);
		return list;
	}

	@Override
	public List<TbMenu> DescfindById(String menu_Id) {
		System.out.println("进来到店面的service");
		List<TbMenu> list = (List<TbMenu>) TbMenuDao.DescfindById(menu_Id);
		return list;
	}

	@Override
	public TbMenu findById(String memId) {
		return TbMenuDao.findByIds(memId);
	}

	@Override
	public int findTotalRows(TbMenu menuModel) {
		// TODO Auto-generated method stub
		return TbMenuDao.findTotalRows(menuModel);
	}

	@Override
	public List<TbMenu> findAllPage(Map<String, String> map) {
		// TODO Auto-generated method stub
		return TbMenuDao.findAllPage(map);
	}

	@Override
	public List<TbMenu> findVague(Page page, TbMenu menu) { 
		return null;
	}

	@Override
	public TbMenu showUpdate(String menuId) {
		
		return TbMenuDao.showUpdate(menuId);
	}
}
